<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        class Book {
            constructor(name, author, price) {
                this.name = name;
                this.author = author;
                this.price = price;
            }
        }

        //通过new关键字产生对象   1
        let book1 = new Book('斗破苍穹', '天蚕土豆', 0);
        //每个对象都有自己的原型对象__proto__  2
        console.log(book1.__proto__);
        //每个构造函数都有prototype属性  3
        console.log(Book.prototype);
        //构造函数的prototype属性指向实例化出来的对象的隐式原型  4
        console.log(Book.prototype == book1.__proto__);//true  
        //构造函数的prototype对象都有constructor，指向构造函数本身 5
        console.log(Book.prototype.constructor == Book);//true
        //prototype本身也是一个对象，也会有自己的隐式原型，
        //指向规则，这样依次往上找，最终会到达null
        console.log(Book.prototype.__proto__.__proto__);//null
        //7
        console.log(Object.prototype === Book.prototype.__proto__);//true
        //8
        console.log(Object.prototype.constructor === Object);//true
        //9
        console.log(Book.__proto__ === Function.prototype);//true
        //10
        console.log(Function.prototype.__proto__ == Object.prototype);//true
        //11
        console.log(Object.__proto__ === Function.prototype);
        //特殊：Function的隐式原型指向Function的prototype  12
        console.log(Function.__proto__ == Function.prototype);//true

        console.log(Function.prototype.constructor === Function);//true

        console.log(Function.prototype == Object.__proto__);//true
        //13 在查找成员时，如果自己本身没有就会到原型链往上去查找
        console.log(Object.__proto__.constructor === Function);//true
        console.log(Object.constructor === Function);//true


        console.log(Book.prototype.constructor==Book);
        let arr = [12, 11, 13];
        console.log(arr.push());




        // let foo=function(){

        // }

        // let foo=new Function()


        // let obj={}
        // let obj=new Object()




    </script>
</body>

</html>